
import { View, Button, Alert, NativeModules } from 'react-native';

const DebugHelper = () => {
  const openDevMenu = () => {
    if (__DEV__) {
      // 尝试打开开发者菜单
      NativeModules.DevMenu.show();
    } else {
      Alert.alert('提示', '开发者菜单仅在开发模式下可用');
    }
  };

  const reloadApp = () => {
    NativeModules.DevSettings.reload();
  };

  return (
    <View style={{ position: 'absolute', top: 50, right: 20, zIndex: 9999 }}>
      <Button title="打开调试菜单" onPress={openDevMenu} />
      <Button title="重新加载" onPress={reloadApp} color="#841584" />
    </View>
  );
};

export default DebugHelper;
